#include <stdio.h>

int main()
{
    float faHeight,moHeight,x;
    char sex,sports,diet;

 //  printf("");
  // scanf("%f %f %c %c %c",&faHeight,&moHeight,&sex,&sports,&diet);


  //  printf("Are you a boy(M) or a girl(F)?");
   // scanf("%c",&sex);
  //  printf("Please input your father's height(cm):");
   // scanf("%f",&faHeight);
  //  printf("Please input your mother's height(cm):");
  //  scanf("%f",&moHeight);

     if (sex=='M')
        x=(faHeight + moHeight) * 0.54;
     else if (sex=='F')
        x=(faHeight * 0.923 + moHeight) / 2;

  //  printf("Do you like sports(Y/N)?");
  //  scanf(" %c",&sports);
        if (sports=='Y')
         x=x*(1+0.02);
        else if (sports=='N')
		 x=x;
  //  printf("Do you have a good habit of diet(Y/N)?");
 //   scanf(" %c",&diet);
         if (diet=='Y')
         x=x*(1+0.015);
         else if (diet=='N')
         x=x;

scanf("%f, %f, %c, %c, %c",&faHeight,&moHeight,&sex,&sports,&diet);
printf(" ",x);
  //  printf("Your future height will be %d(cm)",(int)x);
    return 0;
}
